<?php
/**
 * Created by PhpStorm.
 * User: edmmss
 * Date: 2018/11/8
 * Time: 15:16
 */

namespace app\modules\builder\director;

use app\modules\builder\builderFactory\AbstractBuilder;
use app\modules\builder\parts\Vehicle;

class Director
{
    /**
     * className
     *
     * @date   2018/11/8
     * @author edmmss
     * @param AbstractBuilder $builder
     * @return Vehicle
     */
    public function build(AbstractBuilder $builder): Vehicle
    {
        $builder->createVehicle();
        $builder->addDoors();
        $builder->addEngine();
        $builder->addWheel();

        return $builder->getVehicle();
    }
}